{*
 * This file is part of the Agora distribution. 
 * Detailed copyright and licensing information can be found
 * in the gpl-3.0.txt file which should be included in the distribution.
 * 
 * @version		$Id: 3.0.14 Olympus 2010-09-28 rammstein4o $
 * @copyright  2007 - 2010 jVitals
 * @license   GPLv3 Open Source
 * @link       http://jvitals.com
 * @since      File available since initial release
 *}	

{$html->toolbar->title('##Forums##')}
{$html->toolbar->deleteList()}
{$html->toolbar->editList()}
{if (count($forums) > 0)}
	{$html->toolbar->addNewX('add_forum','ADD FORUM')}
{/if}

{$html->toolbar->addNewX('add_category','ADD CATEGORY')}


<form name="adminForm" method="POST">
	<input type="hidden" name="agora_task" value="forums"/>
	<input type="hidden" name="task" value=""/>
	<input type="hidden" name="option" value="com_agora"/>
	<input type="hidden" name="checked" value="0"/>
	<input type="hidden" name="boxchecked" value="0"/>
	
	<table class="adminlist">
		<thead>
			<th width="20">
				<input type="checkbox" name="toggle" value="" onclick="checkAll({$forum_category_count});" />
			</th>
			<th width="20">##Id##</th>
			<th width="30%">##Name##</th>
			<th width="30%">##Description##</th>
			<th width="10%">##MODERATION_USE##</th>
			<th>##Enabled##</th>
			<th width="100px" nowrap="nowrap">{$html->jhtml('grid.order',null)}##Order##</th>
			<th>##Joopport Mode##</th> {* joopport added *}
			<th>##Questions##</th> {* joopport added *}
			
		</thead>
		<tfoot>
			<tr><td colspan="9">{$pagination->getListFooter()}</td></tr> {* joopport modified *}
		</tfoot>
		<tbody>
			{foreach name=category from=$forums item=category}
			{* cat_id=0 means this is category from previous page *}
			{if $category.cat_id != 0}
			<tr class="row1">
				<td>{$html->jhtml('grid.id', $category.list_number, $category.list_id)}</td>
				<td><strong>{$category.cat_id}</strong></td>
				<td><strong><a href="{url task=forums action=edit_category category_id=$category.cat_id}">{$category.cat_name}</a></strong></td>
				<td>&nbsp;</td>
				<td>&nbsp;</td>
				<td>{$html->form->toggle($category.list_number, $category.enable,'Enable','Disable','cat_enable','cat_disable')}</td>
				<td class="order">
					<span>
					{if !$smarty.foreach.category.first}
						{$pagination->orderUpIcon($category.list_number)}
					{else}
						&nbsp;
					{/if}
					</span>

					<span>
					{if !$smarty.foreach.category.last}
						{$pagination->orderDownIcon($category.list_number, 10000)}
					{else}
						&nbsp;
					{/if}
					</span>
					<input type="text" name="order[category][{$category.cat_id}]" size="3" value="{$category.disp_position}" class="text_area" style="text-align: center" />
				</td>
				<td></td>{* joopport added *}
				<td></td>{* joopport added *}
			</tr>
			{/if}
				{foreach name=forum from=$category.forums key=forum_num item=forum}
				<tr class="row0">
					<td>{$html->jhtml('grid.id', $forum.list_number, $forum.list_id)}</td>
					<td>{$forum.id}</td>
					<td><a href="{url task=forums action=edit_forum forum_id=$forum.id}">
							{section name=forum_level loop=$forum.level+1}
							.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							{/section}
							<sup>|_</sup>&nbsp;
							{$forum.forum_name}
						</a>
					</td>
					<td>{$forum.forum_desc|truncate:50|escape}</td>
					<td>{$html->form->togglesimple($forum.list_number, $forum.use_moderation,'Yes','No')}</td>
					<td>{$html->form->toggle($forum.list_number, $forum.enable,'Enable','Disable','forum_enable','forum_disable')}</td>
					<td class="order">
						<span>{$pagination->orderUpIcon($forum.list_number, $forum.not_first ,'orderup', 'Move Up')}</span>
						<span>{$pagination->orderDownIcon($forum.list_number, 10000, $forum.not_last , 'orderdown', 'Move Down')}</span>
						<input type="text" name="order[forum][{$forum.id}]" size="3" value="{$forum.disp_position}" class="text_area" style="text-align: center" />
					</td>
					<td>{$html->form->toggle($forum.list_number, $forum.forum_type,'Enable','Disable','joopport_enable','joopport_disable')}</td> {* joopport added *}
					<td>{$forum.quest_group}</td> {* joopport added *}
				</tr>
				{/foreach}
			{foreachelse}
			<tr><td colspan="9">##You have no forums nor categories##</td></tr> {* joopport modified *}
			{/foreach}
		</tbody>
	</table>
</form>
  